﻿<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{backdrop: 'static', keyboard: !saving}">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <form *ngIf="active" #userForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span *ngIf="formData.id">编辑</span>
                        <span *ngIf="!formData.id">新建</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')" [disabled]="saving">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <tabset class="tab-container tabbable-line">
                        <tab heading="需求详细信息" customClass="m-tabs__item">
                            <div class="row">
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="unitOfUsing">车间 *</label>
                                        <select  name="unitOfUsing"  class="form-control"  [(ngModel)]="formData.usableRange.unitOfUsing"  required>
                                            <option *ngFor="let optionItem of unitOfUsings" [value]="optionItem.value">{{optionItem.name}}</option>
                                        </select>
                                        <!--<input id="unitOfUsing" #unitOfUsingInput="ngModel" class="form-control" type="text" name="unitOfUsing" [(ngModel)]="formData.usableRange.unitOfUsing" required maxlength="255">
                                        <validation-messages [formCtrl]="unitOfUsingInput"></validation-messages>-->
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="belongToModel">型号 *</label>
                                        <input id="belongToModel" #belongToModelInput="ngModel" type="text" name="belongToModel" class="form-control" [(ngModel)]="formData.usableRange.belongToModel" maxlength="255">
                                        <validation-messages [formCtrl]="belongToModelInput"></validation-messages>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="batch">发次 *</label>
                                        <input id="batch" #batchInput="ngModel" type="text" name="batch" class="form-control" [(ngModel)]="formData.usableRange.batch" required maxlength="255"/>
                                        <validation-messages [formCtrl]="batchInput"></validation-messages>
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="belongToComponent">部段 *</label>
                                        <input id="belongToComponent" #belongToComponentInput="ngModel" type="text" name="belongToComponent" class="form-control" [(ngModel)]="formData.usableRange.belongToComponent" required maxlength="255">
                                        <validation-messages [formCtrl]="belongToComponentInput"></validation-messages>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="requiredQuantityOfModel">型号需求数量 *</label>
                                        <input id="requiredQuantityOfModel" #requiredQuantityOfModelInput="ngModel" type="number" name="requiredQuantityOfModel" class="form-control" [(ngModel)]="formData.requiredQuantityOfModel" required oninput="if(value.length>9)value=value.slice(0,9)">
                                        <validation-messages [formCtrl]="requiredQuantityOfModelInput"></validation-messages>
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="standardPartsDetailId">编码 *</label><br>
                                        <input id="standardPartsDetailId" #standardPartsDetailIdInput="ngModel" type="text" name="standardPartsDetailId" class="form-control" [(ngModel)]="formData.standardPartsDetailId" required maxlength="1032">
                                        <validation-messages [formCtrl]="standardPartsDetailIdInput"></validation-messages>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="userName">车间审核领导 *</label>
                                        <select  name="userName"  class="form-control"  [(ngModel)]="userName"  required>
                                            <option *ngFor="let optionItem of authorityUserOption" [value]="optionItem.userId">{{optionItem.userName}}</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="reason">原因</label><br>
                                        <input id="reason" #reasonInput="ngModel" type="text" name="reason" class="form-control" [(ngModel)]="reason" required maxlength="1032">
                                        <validation-messages [formCtrl]="reasonInput"></validation-messages>
                                    </div>
                                </div>
                            </div>
                        </tab>
                    </tabset>
                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">{{"Cancel" | localize}}</button>
                    <button  type="submit" class="btn btn-primary" [disabled]="!userForm.form.valid" [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')"><i class="fa fa-save"></i> <span>{{"Save" | localize}}</span></button>
                </div>
            </form>
        </div>
    </div>
</div>
